package com.ruoyi.project.system.coachPlan.service;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.coachPlan.mapper.CoachPlanMapper;
import com.ruoyi.project.system.coachPlan.domain.CoachPlan;
import com.ruoyi.project.system.coachPlan.service.ICoachPlanService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 预约计划 服务层实现
 * 
 * @author zhangshilin
 * @date 2019-06-26
 */
@Service
public class CoachPlanServiceImpl implements ICoachPlanService 
{
	@Autowired
	private CoachPlanMapper coachPlanMapper;

	/**
     * 查询预约计划信息
     * 
     * @param coachplanId 预约计划ID
     * @return 预约计划信息
     */
    @Override
	public CoachPlan selectCoachPlanById(Integer coachplanId)
	{
	    return coachPlanMapper.selectCoachPlanById(coachplanId);
	}
	
	/**
     * 查询预约计划列表
     * 
     * @param coachPlan 预约计划信息
     * @return 预约计划集合
     */
	@Override
	public List<CoachPlan> selectCoachPlanList(CoachPlan coachPlan)
	{
	    return coachPlanMapper.selectCoachPlanList(coachPlan);
	}
	
    /**
     * 新增预约计划
     * 
     * @param coachPlan 预约计划信息
     * @return 结果
     */
	@Override
	public int insertCoachPlan(CoachPlan coachPlan)
	{
	    return coachPlanMapper.insertCoachPlan(coachPlan);
	}
	
	/**
     * 修改预约计划
     * 
     * @param coachPlan 预约计划信息
     * @return 结果
     */
	@Override
	public int updateCoachPlan(CoachPlan coachPlan)
	{
	    return coachPlanMapper.updateCoachPlan(coachPlan);
	}

	/**
     * 删除预约计划对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteCoachPlanByIds(String ids)
	{
		return coachPlanMapper.deleteCoachPlanByIds(Convert.toStrArray(ids));
	}
	
	/**
	 * 查询该教练未来10天的计划
	 * @return
	 */
	@Override
	public List<CoachPlan> selectGroupCoach(String phone,String [] nowdate){
		return coachPlanMapper.selectGroupCoach(phone,nowdate);
	}
	
}
